package cn.tedu.review;
/**回顾面向对象的知识
 * 构造代码块->构造方法->普通方法->局部代码块
 * */
public class TestOOP {
    public static void main(String[] args) {
        Teacher t1=new Teacher();
        Teacher t2=new Teacher("语文");
        Teacher t3=new Teacher("毛毛",'女',4500,25);
        t3.ready();
        System.out.println(t3.name+t3.gender+t3.age+t3.salary);


    }

}
class Teacher{
    String name;
    char gender;
    double salary;
    int age;
    {
        System.out.println("我是构造代码块");
    }

    public  void ready(){
        {
            System.out.println("我是局部代码块");
        }
        System.out.println("正在备课...");

    }
    public  void teach(){
        System.out.println("正在授课...");
    }
    public Teacher(){
        System.out.println("我是无参构造");
    }
    public Teacher(String sub){
        System.out.println("我是含参构造"+sub);
    }

    public Teacher(String name, char gender, double salary, int age) {
        this.name = name;
        this.gender = gender;
        this.salary = salary;
        this.age = age;
        System.out.println("我是全参构造");
    }
}